<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="java.util.Calendar" %>
<%@ taglib prefix="s" uri="/struts-tags"%> 
<%

Calendar cal= Calendar.getInstance();
//현재 년도와 현재 달을 +1dms 0~11월 달까지 주어지기때문이
int ny=cal.get(Calendar.YEAR);
int nm=cal.get(Calendar.MONTH)+1;
//이전달 다음달 클릭시 받아오기
String fy =request.getParameter("year");
String fm =request.getParameter("month");

int year=ny;
int month=nm;

if(fy!=null){
	year=Integer.parseInt(fy);
}

if(fm!=null){
	month=Integer.parseInt(fm);
}
//넘오온값을 새로이 cal객체생성한 곳에 입력이 된다 초기화
cal.set(year, month-1,1);

year=cal.get(Calendar.YEAR);
month=cal.get(Calendar.MONTH)+1;
//cal.getActualMaximum는 그달의 마지막일 출력
int ed=cal.getActualMaximum(Calendar.DAY_OF_MONTH);
//오늘 날자
int week=cal.get(Calendar.DAY_OF_WEEK);
%>
<%--<img src="/ssteam/image/..." --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<link rel="stylesheet" type="text/css" href="../schedule/css/shadowbox.css">

<script type="text/javascript" src="../schedule/js/shadowbox.js"></script>
<script type="text/javascript">
 Shadowbox.init({players:["iframe"]});
</script>

<script type="text/javascript">
function insert()
{
	var f=document.frm;
	Shadowbox.open(
			{
				content:"insert.do",
				player:"iframe",
				title:"",
				width:400,
				height:300
			}	
		 );
}
</script>
<title>Insert title here</title>
<s:head theme="ajax"/>
</head>
<body>
<center>
<s:a href="/ssteam/schedule/schedule.do?year=<%=year%>&month=<%=month-1 %>" targets="outcenter" theme="ajax"><img src="/ssteam/image/schedule/back.gif" border=0></s:a>&nbsp;
<b><%=year%>년&nbsp;&nbsp;<%=month%>월</b>
<s:a href="/ssteam/schedule/schedule.do?year=<%=year%>&month=<%=month+1 %>" targets="outcenter" theme="ajax"><img src="/ssteam/image/schedule/forward.gif" border=0></s:a>
<p>

<form method=post action=insert.do name=frm>
<table border=0 width=700>
<tr><td align=left>
<s:a href="/ssteam/worksheet/list_month_man.do?sabun=%{#session.user.sabun}" theme="ajax" targets="outcenter">[개인일지]</s:a>
<s:a href="/ssteam/worksheet/list_month_team.do?sabun=%{#session.user.sabun}" theme="ajax" targets="outcenter">[부서일지]</s:a>
</td>
</tr>
</table>
<table border=0 width=700 height=30>
<tr>
<td align=right colspan=7><a onclick=insert()>일정등록</a></td>
</tr>
<tr bgcolor=bbbbb>
<td align=center><font color=white>일</font></td>
<td align=center><font color=white>월</font></td>
<td align=center><font color=white>화</font></td>
<td align=center><font color=white>수</font></td>
<td align=center><font color=white>목</font></td>
<td align=center><font color=white>금</font></td>
<td align=center><font color=white>토</font></td>
</tr>
</table>
</form>

<table border=1 width=700 height=500>
<tr>
<!-- 1일까지 공백처리 -->
<%
for(int i=1; i<week; i++){
%>
<td>&nbsp;</td>
<%} %>
<!-- 날짜 출력 -->
<%
for(int j=1; j<=ed; j++){
	week++;
	if(week%7==2){
		%>

<tr>
<%} %>
<%if(week%7==2){ %>
<td  align=left valign="top" width=130 onmouseover="this.style.backgroundColor='#eaf0fa'"  onmouseout="this.style.backgroundColor=''"><font color=red><%=j%><br></font><br></td>
<%}else if(week%7==1){ %>
<td align=left valign="top" width=130 onmouseover="this.style.backgroundColor='#eaf0fa'"  onmouseout="this.style.backgroundColor=''"><font color=blue><%=j%><br></font><br></td>
<%}else{ %>
<td align=left valign="top" width=130 style="table-layout:fixed"onmouseover="this.style.backgroundColor='#eaf0fa'"  onmouseout="this.style.backgroundColor=''"><%=j%><br><%if(j==20){%><font size=2>[개]프로젝트</font><%}else if(j==7){%><font size=2>[부]프로젝트</font><%} %><br></td>
<%}} %>
</tr>




</table>

</center>
</body>
</html>